package com.eascs.admin.o2o.internal.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.eascs.admin.common.service.BaseSevice;
import com.eascs.admin.o2o.internal.dao.LoanapplyExpandDao;
import com.eascs.admin.o2o.internal.entity.LoanapplyExpand;
import com.eascs.admin.o2o.internal.form.LoanapplyExpandForm;

/**
 * 修改保证金与管理费
 * 
 * @author ycz
 *
 */
@Service
public class LoanapplyExpandService extends BaseSevice {
	@Autowired
	private LoanapplyExpandDao loanapplyExpandDao;

	/**
	 * 修改保证金与管理费----动态表单
	 * 
	 * @param loanapplyExpandForm
	 */
	@Transactional(transactionManager = "o2oTransactionManager")
	public void update(LoanapplyExpandForm loanapplyExpandForm) {
		loanapplyExpandDao.updateById(loanapplyExpandForm);
	}

	/**
	 * 查询收取保证金与管理费
	 * 
	 * @param loanapplyNo
	 */
	public LoanapplyExpand queryLoanapplyNo(String loanapplyNo) {
		return loanapplyExpandDao.queryLoanapplyNo(loanapplyNo.trim());
	}

	/**
	 * 提交保证金、风险补偿金、管理费 修改状态
	 * @param loanapplyExpand
	 */
	@Transactional(transactionManager = "o2oTransactionManager")
	public int updateWorkFlow(LoanapplyExpand loanapplyExpand) {
		return loanapplyExpandDao.updateWorkFlow(loanapplyExpand);
	}
	
	@Transactional(transactionManager = "o2oTransactionManager")
	public int updateById(LoanapplyExpand loanapplyExpand) {
		return loanapplyExpandDao.updateById(loanapplyExpand);
	}
	/**
	 *根据划拨单号查询  收取保证金情况
	 * @param transferNum
	 * @return
	 */
	public LoanapplyExpand fingByBillCode(String transferNum) {
		return loanapplyExpandDao.findBillCode(transferNum);
	}
	/**
	 * id查询实体
	 * @param id
	 * @return
	 */
	public LoanapplyExpand getById(String id){
		return loanapplyExpandDao.getById(LoanapplyExpand.class, id);
	}
	/**
	 * 根据loanId查询List<LoanapplyExpand>
	 * @param loanId
	 * @return
	 */
	public List<LoanapplyExpand> findLoanId(String loanId){
		return loanapplyExpandDao.findLoanId(loanId);
	}
}
